﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MyHealthByDesignWebsite.Models.MyHealthMeasModelView>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    My Health Check
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<script src="<%: Url.Content("~/Scripts/jquery-1.5.1.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery.validate.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js") %>" type="text/javascript"></script>

<% using (Html.BeginForm("Create", "MyHealthMeasurements", FormMethod.Post)) { %>
    <%: Html.ValidationSummary(true,"Please correct the invalid information") %>
    <fieldset>
        <legend>My Health Measurements</legend>
        

        <div class="editor-field" >
            <%: Html.HiddenFor(model => Model.np.U_UserID) %>
            <%: Html.ValidationMessageFor(model => Model.np.U_UserID)%>
        </div> 


        <div class="editor-label">

            <%: Html.LabelFor(model => Model.np.NP_weight, "Weight")%>
           
        </div>


        <div id="weight" class="editor-field">  
          <%: Html.EditorFor(model => Model.np.NP_weight)%> lbs
            <%: Html.ValidationMessageFor(model => Model.np.NP_weight, "*")%>
        </div> 
        
        <div class="editor-label">
            <%: Html.LabelFor(model => Model.np.NP_heightFt, "Height")%>
            
        </div>
       
       <div id="height" class="editor-field" >
        <%: Html.DropDownListFor(model => Model.np.NP_heightFt, new SelectList(
    new[] 
    {
        new SelectListItem { Value = "1", Text = "1" },
        new SelectListItem { Value = "2", Text = "2" },
        new SelectListItem { Value = "3", Text = "3" },
        new SelectListItem { Value = "4", Text = "4" },
        new SelectListItem { Value = "5", Text = "5" },
        new SelectListItem { Value = "6", Text = "6" },
        new SelectListItem { Value = "7", Text = "7" },
    },
    "Value", "Text"
))%> ft
            <%: Html.ValidationMessageFor(model => Model.np.NP_heightFt, "*")%>
             <%: Html.DropDownListFor(model => Model.np.NP_heightIn, new SelectList(
    new[] 
    {
        new SelectListItem { Value = "0", Text = "0" },
        new SelectListItem { Value = "1", Text = "1" },
        new SelectListItem { Value = "2", Text = "2" },
        new SelectListItem { Value = "3", Text = "3" },
        new SelectListItem { Value = "4", Text = "4" },
        new SelectListItem { Value = "5", Text = "5" },
        new SelectListItem { Value = "6", Text = "6" },
        new SelectListItem { Value = "7", Text = "7" },
         new SelectListItem { Value = "8", Text = "8" },
        new SelectListItem { Value = "9", Text = "9" },
        new SelectListItem { Value = "10", Text = "10" },
        new SelectListItem { Value = "11", Text = "11" },
    },
    "Value", "Text"
))%> in
            <%: Html.ValidationMessageFor(model => Model.np.NP_heightIn)%>
        </div> 
        <div class="editor-label">
            BMI (will automatically calculate when you enter weight and height) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%= Html.ActionLink("What does my BMI mean?", "Details", "WebPage", new { id = "21" }, new { target = "_blank" })%> 
            
        </div>
         <div id="BMI" class="editor-field"  >
                 
        </div>
        

        <div class="editor-field" >
            <%: Html.HiddenFor(model => Model.np.NP_entryDate)%>
           
        </div>
        <div class="editor-field" ">
         <%: Html.ValidationMessageFor(model => Model.np.NP_entryDate)%>
        </div> 
        <div class="editor-field">
            <%: Html.HiddenFor(model => Model.hp.U_UserID)  %>
            
        </div>
        <div class="editor-field" >
        <%: Html.ValidationMessageFor(model => Model.hp.U_UserID)%>
        </div> 
        <div class="editor-label">
            <%: Html.LabelFor(model => Model.hp.HP_waistCircumference, "Waist Circumference")%>
            
        </div>
        <div class="editor-field" >
          <%: Html.EditorFor(model => Model.hp.HP_waistCircumference, new { style = "width:50px" })%> inches
            <%: Html.ValidationMessageFor(model => Model.hp.HP_waistCircumference,"*")%>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%= Html.ActionLink("How do I measure waist circumference?", "Details", "WebPage", new { id = "3" }, new { target = "_blank" })%> 
            
        </div> 
        <div class="editor-label">
            <%: Html.LabelFor(model => Model.hp.HP_bloodPressureLow, "Blood Pressure") %>
           
        </div>
     
        <div class="editor-field" >
         <%: Html.EditorFor(model => Model.hp.HP_bloodPressureLow, new { style = "width:50px" })%>/
            <%: Html.ValidationMessageFor(model => Model.hp.HP_bloodPressureLow, "*")%> 
            <%: Html.EditorFor(model => Model.hp.HP_bloodPressureHigh, new { style = "width:50px" })%> mmHg
            <%: Html.ValidationMessageFor(model => Model.hp.HP_bloodPressureHigh, "*")%>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%= Html.ActionLink("What If I Don’t Know My Blood Pressure?", "Details", "WebPage", new { id = "2" }, new { target = "_blank" })%> 
        </div> 
        <div class="editor-label">
            <%: Html.LabelFor(model => Model.hp.HP_heartRate, "Resting Heart Rate")%>
             
        </div>
        <div class="editor-field" >
         <%: Html.EditorFor(model => Model.hp.HP_heartRate)%> bpm
            <%: Html.ValidationMessageFor(model => Model.hp.HP_heartRate, "*")%>
             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%= Html.ActionLink("How do I measure my heart rate?", "Details", "WebPage", new { id = "1" }, new { target = "_blank" })%> 
        </div> 
        <div class="editor-label">
            <%: Html.LabelFor(model => Model.hp.HP_bloodGlucose, "Blood Glucose")%>
          
        </div>
           
        <div class="editor-field" >
          <%: Html.EditorFor(model => Model.hp.HP_bloodGlucose)%> 
            <%: Html.ValidationMessageFor(model => Model.hp.HP_bloodGlucose)%>
               &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%= Html.ActionLink("What If I Don't Know My Blood Glucose?", "Details", "WebPage", new { id = "4" }, new { target = "_blank" })%> 
    
        </div> 
        <div class="editor-label">
            <%: Html.LabelFor(model => Model.hp.HP_totalCholestrol, "Total Cholesterol")%>
            
        </div>
       
       <div class="editor-field" >
        <%: Html.EditorFor(model => Model.hp.HP_totalCholestrol)%> 
            <%: Html.ValidationMessageFor(model => Model.hp.HP_totalCholestrol)%>
             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%= Html.ActionLink("How Do I Know Cholesterol Values?", "Details", "WebPage", new { id = "5" }, new { target = "_blank" })%> 
    
        </div> 
        <div class="editor-label">
            <%: Html.LabelFor(model => Model.hp.HP_LDL, "LDL Cholesterol")%>
             
        </div>
        
        <div class="editor-field" >
         <%: Html.EditorFor(model => Model.hp.HP_LDL)%> 
            <%: Html.ValidationMessageFor(model => Model.hp.HP_LDL)%>
        </div>
        <div class="editor-label">
            <%: Html.LabelFor(model => Model.hp.HP_HDL, "HDL Cholesterol")%>
             
        </div>
         <div class="editor-field" >
         <%: Html.EditorFor(model => Model.hp.HP_HDL)%> 
            <%: Html.ValidationMessageFor(model => Model.hp.HP_HDL)%>
        </div>
        <div class="editor-field">
            <%: Html.HiddenFor(model => Model.hp.HP_entryDate)%>
            <%: Html.ValidationMessageFor(model => Model.hp.HP_entryDate)%>
        </div>
        <div class="editor-label">
            <%: Html.LabelFor(model => Model.np.AL_activityLevelID,"Activity Level") %>
        </div>
        <div class="editor-field" >
            <%: Html.DropDownListFor(model => Model.np.AL_activityLevelID, (IEnumerable<SelectListItem>)Model.ViewBag)%>
            <%: Html.ValidationMessageFor(model => Model.np.AL_activityLevelID, "*")%>
             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%= Html.ActionLink("How do I determine my activity level?", "Details", "WebPage", new { id = "6" }, new { target = "_blank" })%> 
        </div>

      <p style = "text-align:center">
            <input type="submit" value="Continue"/>
        </p>
        
    </fieldset>
<% } %>
     
<script type="text/javascript">
    $('#weight').change(function () {
        var sel1 = $("#np_NP_weight").val();
        var sel2 = $("#np_NP_heightFt").val();
        var sel3 = $("#np_NP_heightIn").val();
        if (sel1.length > 0) {
            $.post('<%=Url.Action("BMI", "MyHealthMeasurements")%>', { weight: sel1, heightFt: sel2, heightIn: sel3 },
         function (data) { $('#BMI').html(data) })
        }
    });
 </script>

 <script type="text/javascript">
     $('#height').change(function () {
         var sel1 = $("#np_NP_weight").val();
         var sel2 = $("#np_NP_heightFt").val();
         var sel3 = $("#np_NP_heightIn").val();
         if (sel1.length > 0) {
             $.post('<%=Url.Action("BMI", "MyHealthMeasurements")%>', { weight: sel1, heightFt: sel2, heightIn: sel3 },
         function (data) { $('#BMI').html(data) })
         }
     });
 </script>
  
</asp:Content>
